3.453 \(\int (c \cos (e+f x))^m (a+b \cos (e+f x)) (A+B \cos (e+f x)) \, dx\)

Optimal. Leaf size=196 \[ -\frac{(a B+A b) \sin (e+f x) (c \cos (e+f x))^{m+2} \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(e+f x)\right )}{c^2 f (m+2) \sqrt{\sin ^2(e+f x)}}-\frac{\sin (e+f x) (a A (m+2)+b B (m+1)) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac{1}{2},\frac{m+1}{2};\frac{m+3}{2};\cos ^2(e+f x)\right )}{c f (m+1) (m+2) \sqrt{\sin ^2(e+f x)}}+\frac{b B \sin (e+f x) (c \cos (e+f x))^{m+1}}{c f (m+2)} \]

[Out]

(b*B*(c*Cos[e + f*x])^(1 + m)*Sin[e + f*x])/(c*f*(2 + m)) - ((b*B*(1 + m) + a*A*(2 + m))*(c*Cos[e + f*x])^(1 +
 m)*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(c*f*(1 + m)*(2 + m)*Sqrt[Sin[e
 + f*x]^2]) - ((A*b + a*B)*(c*Cos[e + f*x])^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^
2]*Sin[e + f*x])/(c^2*f*(2 + m)*Sqrt[Sin[e + f*x]^2])

________________________________________________________________________________________

Rubi [A]  time = 0.246398, antiderivative size = 196, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.129, Rules used = {2968, 3023, 2748, 2643} \[ -\frac{(a B+A b) \sin (e+f x) (c \cos (e+f x))^{m+2} \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(e+f x)\right )}{c^2 f (m+2) \sqrt{\sin ^2(e+f x)}}-\frac{\sin (e+f x) (a A (m+2)+b B (m+1)) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac{1}{2},\frac{m+1}{2};\frac{m+3}{2};\cos ^2(e+f x)\right )}{c f (m+1) (m+2) \sqrt{\sin ^2(e+f x)}}+\frac{b B \sin (e+f x) (c \cos (e+f x))^{m+1}}{c f (m+2)} \]

Antiderivative was successfully verified.

[In]

Int[(c*Cos[e + f*x])^m*(a + b*Cos[e + f*x])*(A + B*Cos[e + f*x]),x]

[Out]

(b*B*(c*Cos[e + f*x])^(1 + m)*Sin[e + f*x])/(c*f*(2 + m)) - ((b*B*(1 + m) + a*A*(2 + m))*(c*Cos[e + f*x])^(1 +
 m)*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[e + f*x]^2]*Sin[e + f*x])/(c*f*(1 + m)*(2 + m)*Sqrt[Sin[e
 + f*x]^2]) - ((A*b + a*B)*(c*Cos[e + f*x])^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[e + f*x]^
2]*Sin[e + f*x])/(c^2*f*(2 + m)*Sqrt[Sin[e + f*x]^2])

Rule 2968

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rubi steps

\begin{align*} \int (c \cos (e+f x))^m (a+b \cos (e+f x)) (A+B \cos (e+f x)) \, dx &=\int (c \cos (e+f x))^m \left (a A+(A b+a B) \cos (e+f x)+b B \cos ^2(e+f x)\right ) \, dx\\ &=\frac{b B (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m)}+\frac{\int (c \cos (e+f x))^m (c (b B (1+m)+a A (2+m))+(A b+a B) c (2+m) \cos (e+f x)) \, dx}{c (2+m)}\\ &=\frac{b B (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m)}+\frac{(A b+a B) \int (c \cos (e+f x))^{1+m} \, dx}{c}+\left (a A+\frac{b B (1+m)}{2+m}\right ) \int (c \cos (e+f x))^m \, dx\\ &=\frac{b B (c \cos (e+f x))^{1+m} \sin (e+f x)}{c f (2+m)}-\frac{\left (a A+\frac{b B (1+m)}{2+m}\right ) (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac{1}{2},\frac{1+m}{2};\frac{3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c f (1+m) \sqrt{\sin ^2(e+f x)}}-\frac{(A b+a B) (c \cos (e+f x))^{2+m} \, _2F_1\left (\frac{1}{2},\frac{2+m}{2};\frac{4+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{c^2 f (2+m) \sqrt{\sin ^2(e+f x)}}\\ \end{align*}

Mathematica [A]  time = 0.32474, size = 151, normalized size = 0.77 \[ -\frac{\sin (e+f x) \cos (e+f x) (c \cos (e+f x))^m \left ((a A (m+2)+b B (m+1)) \, _2F_1\left (\frac{1}{2},\frac{m+1}{2};\frac{m+3}{2};\cos ^2(e+f x)\right )+(m+1) \left ((a B+A b) \cos (e+f x) \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(e+f x)\right )-b B \sqrt{\sin ^2(e+f x)}\right )\right )}{f (m+1) (m+2) \sqrt{\sin ^2(e+f x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[(c*Cos[e + f*x])^m*(a + b*Cos[e + f*x])*(A + B*Cos[e + f*x]),x]

[Out]

-((Cos[e + f*x]*(c*Cos[e + f*x])^m*Sin[e + f*x]*((b*B*(1 + m) + a*A*(2 + m))*Hypergeometric2F1[1/2, (1 + m)/2,
 (3 + m)/2, Cos[e + f*x]^2] + (1 + m)*((A*b + a*B)*Cos[e + f*x]*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, C
os[e + f*x]^2] - b*B*Sqrt[Sin[e + f*x]^2])))/(f*(1 + m)*(2 + m)*Sqrt[Sin[e + f*x]^2]))

________________________________________________________________________________________

Maple [F]  time = 1.793, size = 0, normalized size = 0. \begin{align*} \int \left ( c\cos \left ( fx+e \right ) \right ) ^{m} \left ( a+b\cos \left ( fx+e \right ) \right ) \left ( A+B\cos \left ( fx+e \right ) \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*cos(f*x+e))^m*(a+b*cos(f*x+e))*(A+B*cos(f*x+e)),x)

[Out]

int((c*cos(f*x+e))^m*(a+b*cos(f*x+e))*(A+B*cos(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \cos \left (f x + e\right ) + A\right )}{\left (b \cos \left (f x + e\right ) + a\right )} \left (c \cos \left (f x + e\right )\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(a+b*cos(f*x+e))*(A+B*cos(f*x+e)),x, algorithm="maxima")

[Out]

integrate((B*cos(f*x + e) + A)*(b*cos(f*x + e) + a)*(c*cos(f*x + e))^m, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (B b \cos \left (f x + e\right )^{2} + A a +{\left (B a + A b\right )} \cos \left (f x + e\right )\right )} \left (c \cos \left (f x + e\right )\right )^{m}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(a+b*cos(f*x+e))*(A+B*cos(f*x+e)),x, algorithm="fricas")

[Out]

integral((B*b*cos(f*x + e)^2 + A*a + (B*a + A*b)*cos(f*x + e))*(c*cos(f*x + e))^m, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))**m*(a+b*cos(f*x+e))*(A+B*cos(f*x+e)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \cos \left (f x + e\right ) + A\right )}{\left (b \cos \left (f x + e\right ) + a\right )} \left (c \cos \left (f x + e\right )\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*cos(f*x+e))^m*(a+b*cos(f*x+e))*(A+B*cos(f*x+e)),x, algorithm="giac")

[Out]

integrate((B*cos(f*x + e) + A)*(b*cos(f*x + e) + a)*(c*cos(f*x + e))^m, x)